package com.csp.mingyue.push.mq.consumer;

import com.csp.mingyue.sms.api.dto.MqMessageDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.function.Consumer;

/**
 * Rocket MQ 消费者
 *
 * @author Strive
 * @date 2023/9/21 19:59
 */
@Slf4j
@Component
public class RocketMqConsumer {

	@Bean
	Consumer<MqMessageDto> rocketmqDemo() {
		log.info("Rocket MQ 初始化订阅");
		return msg -> {
			log.info("通过 Rocket MQ 消费到消息 => {}", msg.toString());
		};
	}

}
